package com.zhuzl.stockservice.controller;


import com.zhuzl.stockservice.service.StockInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author JZY001
 */
@RefreshScope
@RestController
@RequestMapping("/stock")
public class StorageController {

    @Autowired
    private StockInfoService stockInfoService;

    @PostMapping("/test/decrease")
    public ResponseEntity<Void> decrease(Integer id, Integer count) {
        stockInfoService.decrease(id, count);
        return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
    }

}
